echo off
rem
rem USAGE: mk "COMMAND"
rem
rem
echo on
set LIBS=pio.obj dump.obj

if "%1" == "clean"	goto CLEAN

:BORLANDC++
	set CC=bcc -c 
	set AS=tasm
	set LD=bcc 
	set AR=tlib
	goto BUILD

:BUILD
if exist pio.obj   goto LABEL01
	%CC% pio.c
:LABEL01
if exist dump.obj  goto LABEL02
	%CC% dump.c
:LABEL02
if exist mdump.exe goto LABEL03
	%CC% -DTEST mdump.c
	%LD% mdump.obj %LIBS%
:LABEL03
if exist vdump.exe goto LABEL04
	%CC% -DTEST vdump.c
	%LD% vdump.obj %LIBS%
:LABEL04
if exist tdump.exe goto LABEL05
	%CC% -DTEST tdump.c
	%LD% tdump.obj %LIBS%
:LABEL05
if exist pdump.exe goto LABEL06
	%CC% -DTEST pdump.c
	%LD% pdump.obj %LIBS%
:LABEL06
if exist kdump.exe goto LABEL07
	%CC% -DTEST kdump.c
	%LD% kdump.obj %LIBS%
:LABEL07
if exist cdump.exe goto LABEL08
	%CC% -DTEST cdump.c
	%LD% cdump.obj %LIBS%
:LABEL08
set LIBS=pio.obj
if exist go.exe goto    LABEL09
	%CC% -DTEST go.c
	%LD% go.obj %LIBS%
:LABEL09
if exist exec.exe goto  LABEL10
	%LD% exec.c myank.c %LIBS%
:LABEL10
if exist myank.exe goto LABEL11
	%CC% -DTEST myank.c
	%LD% myank.obj %LIBS%
:LABEL11
if exist tyank.exe goto LABEL12
	%CC% -DTEST tyank.c
	%LD% tyank.obj %LIBS%
:LABEL12
if exist pyank.exe goto LABEL13
	%CC% -DTEST pyank.c
	%LD% pyank.obj %LIBS%
:LABEL13
if exist vyank.exe goto LABEL15
	%CC% -DTEST vyank.c
	%LD% vyank.obj %LIBS%
:LABEL15
if exist kyank.exe goto LABEL16
	%CC% -DTEST kyank.c
	%LD% kyank.obj %LIBS%
:LABEL16
if exist cyank.exe goto LABEL17
	%CC% -DTEST cyank.c
	%LD% cyank.obj %LIBS%
:LABEL17
if exist a.bin goto LABEL18
	fxcc -LK"-Ba.bin" a.c
:LABEL18
if exist rst.exe goto LABEL19
	%LD% rst.c %LIBS%
:LABEL19
goto :END

:CLEAN
	del *.obj
	del *.exe

:END
